Begin[System]

Begin[`Integrate]

`Rules = {
`A[x_, x_] :> x^2/2,
`A[f_ + g_, x_] :> `A[f, x] + `A[g, x],
`A[a_ f_, x_] :> (a) `A[f, x] /; FreeQ[a, x],
`A[a_, x_] :> a x /; FreeQ[a, x],
`A[x_^n_, x_] :> If[n === -1, Log[x], x^(1 + n)/(1 + n)] /; FreeQ[n, x],
`A[System`E^x_, x_] :> System`E^x,
`A[a_^x_, x_] :> a^x/Log[a] /; FreeQ[a, x],
`A[Sin[x_], x_] :> -Cos[x],
`A[Cos[x_], x_] :> Sin[x],
`A[Csc[x_]^2, x_] :> -Cot[x],
`A[Sec[x_]^2, x_] :> Tan[x],
`A[Sec[x_] Tan[x_], x_] :> Sec[x],
`A[Cot[x_] Csc[x_], x_] :> -Csc[x],
`A[Tan[x_], x_] :> -Log[Cos[x]],
`A[Cot[x_], x_] :> Log[Sin[x]],
`A[Csc[x_], x_] :> -Log[2 Cos[x/2]] + Log[2 Sin[x/2]],
`A[Sec[x_], x_] :> -Log[Cos[x/2] - Sin[x/2]] + Log[Cos[x/2] + Sin[x/2]],
`A[1/(1 + x_^2), x_] :> ArcTan[x],
`A[1/(1 - x_^2), x_] :> 1/2 Log[-1 - x] - 1/2 Log[-1 + x],
`A[1/Sqrt[1 - x_^2], x_] :> ArcSin[x],
`A[1/Sqrt[1 + x_^2], x_] :> ArcSinh[x],
`A[1/Sqrt[-1 + x_^2], x_] :> Log[2 (x + Sqrt[-1 + x^2])],
`A[Sinh[x_], x_] :> Cosh[x],
`A[Cosh[x_], x_] :> Sinh[x],
`A[Csch[x_]^2, x_] :> -Coth[x],
`A[Sech[x_]^2, x_] :> Tanh[x],
`A[Tanh[x_], x_] :> Log[Cosh[x]],
`A[Coth[x_], x_] :> Log[Sinh[x]],
`A[Csch[x_], x_] :> -Log[2 Cosh[x/2]] + Log[2 Sinh[x/2]],
`A[Sqrt[b_ + a_ x_], x_] :> (2 (b + a x)^(3/2))/(3 a) /; FreeQ[{a, b}, x],
`A[x_ Sqrt[b_ + a_ x_], x_] :> (2 Sqrt[b + a x] (-2 b^2 + a b x + 3 a^2 x^2))/(15 a^2) /; FreeQ[{a, b}, x],
`A[Sqrt[x_ + Sqrt[x_]], x_] :> 1/12 Sqrt[Sqrt[x] + x] (-3 + 2 Sqrt[x] + 8 x) + 1/8 Log[1 + 2 Sqrt[x] + 2 Sqrt[Sqrt[x] + x]],
`A[x_^n_ Sqrt[a_ x_ + b_], x_] :> (2 x^n)/((2 n + 3) a) (Sqrt[(a x + b)])^3 - (2 n b)/((2 n + 3) a) `A[x^(n - 1) Sqrt[a x + b], x] /; FreeQ[{n, a, b}, x],
`A[f_[a_ x_ + b_], x_] :> `A[f[a x + b],a x + b] / a /; FreeQ[{a, b}, x]
}

`Rules = CSerial@@`Rules
Integrate[f_,x_] := `A[f, x] //. `Rules

End[]

End[]
